package com.xy;
import com.xy.creature.Creature;
/**
 * @description:房间
 * @author: Xiang Yao
 * @date: Created in 2020/6/7
 */
public class Room<String, HashMap> {
    private String id;
    private String description;
    private java.util.HashMap<String, Room> reachableRooms = new java.util.HashMap();
    private Creature creature;

    public Room(java.lang.String id, java.lang.String room) {
    }

    public  void addReachableRoom(String roomId,Room room){
        this.reachableRooms.put(roomId, room);
    }
    public Room searchReachableRoomById(String targetRoomId, java.util.HashMap<String, Room> reachableRooms) {
        Room room = null;
        if (reachableRooms.containsKey(targetRoomId)) {
            room = (Room)reachableRooms.get(targetRoomId);
        }

        return room;
    }
    public java.lang.String toString() {
        return (java.lang.String) this.description;
    }

    public Room() {
    }

    public Room(String id, String description, java.util.HashMap<String, Room> reachableRooms, Creature creature) {
        this.id = id;
        this.description = description;
        this.reachableRooms = reachableRooms;
        this.creature = creature;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public java.util.HashMap<String, Room> getReachableRooms() {
        return reachableRooms;
    }

    public void setReachableRooms(java.util.HashMap<String, Room> reachableRooms) {
        this.reachableRooms = reachableRooms;
    }

    public Creature getCreature() {
        return creature;
    }

    public void setCreature(Creature creature) {
        this.creature = creature;
    }
}
